unit kernel;
 
interface
 
uses multiboot, console;


procedure StartOS(mbinfo: PMultiBootInfo; mbmagic: DWORD); stdcall;
 
implementation
 
procedure StartOS(mbinfo: PMultiBootInfo; mbmagic: DWORD); stdcall; [public, alias: 'StartOS'];
begin
        ClearScreen();
        GoToXY(0,0);
	kwritestr('Ultim8 OS 2014');
        GotoXY(10,1);
 
        if (mbmagic <> MultiBootBootloaderMagic) then
        begin
                kwritestr('Halting system, a multiboot-compliant boot loader needed!');
                asm
                        cli
                        hlt
                end;
        end
        else
        begin
                Console.Init; 
                kwritestr('Boot Loader Passed');
                GoToXY(10,2);
                CursorPosX := 0;
                CursorPosY += 2;
                kwritestr('Information:');
                GoToXY(15,4);
                CursorPosX := 0;
                CursorPosY += 2;
                kwritestr('Lower memory  = ');
                kwriteint(mbinfo^.LowerMemory);
                kwritestr('KB');
                GoToXY(15,5);
                CursorPosX := 0;
                CursorPosY += 1;
                kwritestr('                       Higher memory = ');
                kwriteint(mbinfo^.UpperMemory);
                kwritestr('KB');
                GoToXY(15,7);
                CursorPosX := 0;
                CursorPosY += 1;
                kwritestr('Total memory  = ');
                kwriteint(((mbinfo^.UpperMemory + 1000) div 1024) +1);
                kwritestr('MB');
                //Console.Init;
        end;
 
        asm
                @loop:
                jmp @loop
        end;
end;
 
end.
